function main() {
    Java.perform(function x() {

        var handler;

        var BufferType;
        Java.choose("android.widget.TextView$BufferType", {
            //枚举时调用
            onMatch: function (x) {
                //打印实例
                BufferType = x;

            },
            //枚举完成后调用
            onComplete: function () {
                console.log("end")
            }
        });

        let AccountLoginActivity = Java.use("com.immomo.android.mvvm.accountlogin.presentation.view.AccountLoginActivity");

        AccountLoginActivity.onCreate.implementation = function (bundle){
            console.log('onCreate is called');
            return this.onCreate(bundle);
        }

        let AccountLoginFragment = Java.use("com.immomo.android.mvvm.accountlogin.presentation.view.AccountLoginFragment")
        var accountLoginFragment = null
        AccountLoginFragment.initViews.implementation = function(view){
            console.log('initViews is called')
            this.initViews(view)



        };
        Java.choose("com.immomo.android.mvvm.accountlogin.presentation.view.AccountLoginFragment", {
            //枚举时调用
            onMatch: function (instance ) {
                console.log("onMatch")
                accountLoginFragment = instance
            },
            //枚举完成后调用
            onComplete: function () {
                console.log("onComplete")
            }
        });

        var Handler = Java.use('android.os.Handler');

        var handler
        var MyHandler = Java.registerClass({
            name: 'com.test.pq.MyHandler',
            superClass: Handler,
            methods: {
                //public Handler(Looper looper)
                $init: {
                    argumentTypes: ['android.os.Looper'],
                    implementation: function (looper) {
                        Handler.$init.overload('android.os.Looper').call(this, looper)
                    }
                },
                handleMessage: {
                    returnType: 'void',
                    argumentTypes: ['android.os.Message'],
                    implementation: function (msg) {

                        var bundle = msg.getData();
                        var what = bundle.get('what');
                        console.log('handleMessage:' + what)


                            {
                                let str_ = Java.use("java.lang.String")
                                let AppCompatEditText = Java.use("androidx.appcompat.widget.AppCompatEditText")
                                let viewId = accountLoginFragment.findViewById(0x7f091c32)
                                let editText = Java.cast(viewId, AppCompatEditText)
                                let accountTxt = editText.getText()
                                editText.setText(str_.$new("123456"), BufferType.valueOf('NORMAL'))


                                var mmid = Java.cast(accountTxt, Java.use('android.text.SpannableStringBuilder')).toString()

                                if (mmid.indexOf("18847717") == 0){
                                    console.log(111111 )
                                    editText.setText(str_.$new("854229318"), BufferType.valueOf('NORMAL'))
                                }

                                if (mmid.indexOf("854229318") == 0){
                                    console.log(2222222 )
                                    editText.setText(str_.$new("744851517"), BufferType.valueOf('NORMAL'))
                                }

                                if (mmid.indexOf("744851517") == 0){
                                    console.log(3333333 )
                                    editText.setText(str_.$new("18847717"), BufferType.valueOf('NORMAL'))
                                }
                            }

                            {
                                let str_ = Java.use("java.lang.String")
                                let AppCompatEditText = Java.use("androidx.appcompat.widget.AppCompatEditText")
                                let viewId = accountLoginFragment.findViewById(0x7f091c33)
                                let editText = Java.cast(viewId, AppCompatEditText)
                                editText.setText(str_.$new("testst12121"), BufferType.valueOf('NORMAL'))
                            }



                       //accountLoginFragment.e('18847717')


                        {
                            var msg = Java.use('android.os.Message').$new();
                            var bundle = Java.use('android.os.Bundle').$new()
                            bundle.putShort('what', 20);
                            msg.setData(bundle);

                            handler.sendMessageDelayed(msg, 10000);
                        }

                    }
                }
            }
        });


        {
            var msg = Java.use('android.os.Message').$new();
            var bundle = Java.use('android.os.Bundle').$new()
            bundle.putShort('what', 10);
            msg.setData(bundle);
            console.log('----->' + msg.toString())
            handler = MyHandler.$new(Java.use("android.os.Looper").getMainLooper());
            handler.sendMessageDelayed(msg, 10000);
        }
        // let MaintabActivity = Java.use("com.immomo.momo.maintab.MaintabActivity");
        // MaintabActivity["onCreate"].implementation = function(bundle){
        //     console.log('onCreate is called');
        //     return  this.onCreate(bundle);
        // };

    })
}
setImmediate(main)


//frida -U -f com.immomo.momo --no-pause -l imomo.js
//frida -U com.immomo.momo --no-pause -l imomo.js